home *** CD-ROM | disk | FTP | other *** search
Java Source | 2000-06-26 | 22.3 KB | 685 lines |
- // eHelpÆ Corporation
- // Copyright© 1998-2000 eHelpÆ Corporation.All rights reserved.
- // ShowWebHelp.js
- // The Helper class for WebHelp Content Sensitive Help
-
- package robohelp;
-
- import netscape.javascript.*;
- import java.applet.Applet;
- import java.net.*;
- import java.io.File;
-
-
- public class ShowWebHelp
- {
- public static final int WOF_LOCATION = 0x1;
- public static final int WOF_MENUBAR = 0x2;
- public static final int WOF_RESIZABLE = 0x4;
- public static final int WOF_TOOLBAR = 0x8;
- public static final int WOF_STATUS = 0x10;
- public static final int WOF_SCROLLBARS = 0x20;
-
- public static boolean context(String strURL, String strTopic, int left, int top, int width, int height, int flag, Applet applet) {
- return context(strURL, strTopic, getOptionsString(left, top, width, height, flag), applet);
- }
-
- public static boolean context(String strURL, String strTopic, String strWindowOption, Applet applet) {
- String strTemp = "";
- int posbegin = 0;
- do {
- int pos = strTopic.indexOf("://", posbegin);
- if (pos != -1) {
- strTemp += strTopic.substring(posbegin, pos) + "%072%057%057";
- posbegin = pos + 3;
- }
- else {
- strTemp += strTopic.substring(posbegin);
- break;
- }
- } while (true);
- strTopic = strTemp;
- // strTopic = strTopic.replace('://', '%072%057%057');
- String strURLWithTopic = strURL + "#" + strTopic;
- boolean bJSAccessable = true;
- URL url = null;
-
- if (System.getProperty("java.vendor").indexOf("Netscape") == -1 ) {// IE
- try {
- String strURLWithWindowOption = strURLWithTopic + "," + strWindowOption;
- url = makeURL(applet.getDocumentBase(),strURLWithWindowOption, strURLWithWindowOption);
- JSObject win = JSObject.getWindow(applet);
- win.eval("window.open(\"" + url.toString() + "\", \"HelpSecondary\", \"left=2000,top=2000,height=1,width=1\");");
- return true;
- }
- catch (Exception e) {
- bJSAccessable = false;
- e.printStackTrace();
- }
- if (!bJSAccessable) {
- try {
- String strURLWithWindowOption = strURLWithTopic + "," + strWindowOption;
- url = makeURL(applet.getDocumentBase(), strURLWithWindowOption, strURLWithWindowOption);
- System.out.println(url.toString());
- applet.getAppletContext().showDocument(url, "HelpSecondary");
- return true;
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
- return false;
- }
- else { // netscape
- try {
- url = makeURL(applet.getDocumentBase(),strURLWithTopic, strURLWithTopic);
- JSObject win = JSObject.getWindow(applet);
- win.eval("window.open(\"" + url.toString() + "\", \"HelpStub\", \"" + strWindowOption + "\");");
- return true;
- }
- catch (Exception e) {
- bJSAccessable = false;
- e.printStackTrace();
- }
- if (!bJSAccessable) {
- try {
- String strURLWithWindowOption = strURLWithTopic + "," + strWindowOption;
- url = makeURL(applet.getDocumentBase(), strURLWithWindowOption, strURLWithWindowOption);
- applet.getAppletContext().showDocument(url, "HelpSecondary");
- return true;
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
- return false;
- }
- }
-
- public static String getOptionsString(int left, int top, int width, int height, int flag)
- {
- String strWindowOptions = "";
- strWindowOptions += "left=" + Integer.toString(left,10);
- strWindowOptions += ",ScreenX=" + Integer.toString(left,10);
-
- strWindowOptions += ",top=" + Integer.toString(top,10);
- strWindowOptions += ",ScreenY=" + Integer.toString(top,10);
-
- strWindowOptions += ",width=" + Integer.toString(width,10);
- strWindowOptions += ",OuterWidth=" + Integer.toString(width,10);
-
- strWindowOptions += ",height=" + Integer.toString(height,10);
- strWindowOptions += ",OuterHeight=" + Integer.toString(height,10);
-
- if ((flag & WOF_LOCATION) != 0) {
- strWindowOptions += ",location=yes";
- }
- else {
- strWindowOptions += ",location=no";
- }
-
- if ((flag &WOF_MENUBAR) != 0) {
- strWindowOptions += ",menubar=yes";
- }
- else {
- strWindowOptions += ",menubar=no";
- }
- if ((flag &WOF_RESIZABLE) != 0) {
- strWindowOptions += ",resizable=yes";
- }
- else {
- strWindowOptions += ",resizable=no";
- }
- if ((flag &WOF_TOOLBAR) != 0) {
- strWindowOptions += ",toolbar=yes";
- }
- else {
- strWindowOptions += ",toolbar=no";
- }
- if ((flag &WOF_STATUS) != 0) {
- strWindowOptions += ",status=yes";
- }
- else {
- strWindowOptions += ",status=no";
- }
- if ((flag &WOF_SCROLLBARS) != 0) {
- strWindowOptions += ",scrollbars=yes";
- }
- else {
- strWindowOptions += ",scrollbars=no";
- }
- return strWindowOptions;
- }
-
- // return a URL build from the local and url parameters
- static URL makeURL (URL base, String local, String url) throws MalformedURLException
- {
- try {
- //return new URL (base, local);
- String protocol = base.getProtocol();
- String host = base.getHost();
- String file = base.getFile();
- int port = base.getPort();
-
- String fileNew0 = tuHtmlToText(file);
- String fileNew1 = GetNormalizedLocal(fileNew0);
- String fileNew = TruncURLtoQuestionMark(fileNew1);
- URL baseNew = new URL(protocol,host,port,fileNew);
-
- String localNew0 = tuHtmlToText(local);
- String localNew = GetNormalizedLocal(localNew0);
- return new URL (baseNew, localNew);
- }
- catch (MalformedURLException x) {
- x.printStackTrace();
-
- // no it isn't - but it might be
- // a MS-type file spec (eg e:\temp\foo)
- // so try opening it as a file
- // god knows what this will do on
- // a unix machine...
-
- File f = new File (local);
- if (f.exists ()) {
- // OK - it's a local file, try appending
- // "file:/" onto it and opening it - even
- // though the slashes will be all funny
- // this seems to work!
- return new URL ("file:/" + local);
- }
- else {
-
- // the file doesn't exist....
- // should display a dialog box here
- // and now try the secondary URL
-
- return new URL (base, url);
- }
- }
- }
-
- static String TruncURLtoQuestionMark(String str)
- {
- String strRc = str;
- int nQuestionMarkPos = str.indexOf('?');
- if (nQuestionMarkPos != -1) {
- strRc = str.substring(0, nQuestionMarkPos);
- }
- return strRc;
- }
-
- static String GetNormalizedLocal(String str)
- {
- String local = str;
- // fix up special characters (for netscape)
- for (int i = 0; i < local.length(); i++)
- {
- if (local.charAt(i) > 127)
- {
- local = local.substring(0, i) + "%" + Integer.toString(local.charAt(i), 16) + local.substring(i + 1, local.length());
- }
- }
- return local;
- }
-
- //To Do: need a utility to convert html<->text
- //Copy from SiteMapParserToContents
- //String fixSpecialCharacters(String value)
- static String tuHtmlToText(String value)
- {
- if (value == null)
- return null;
-
- // TODO: This should be common in SiteMapParser or something
- int i = value.indexOf('&');
-
- if (i < 0) return value;
-
- String strOut = "";
-
- // have to convert & and the like
- while (i > -1 && i < value.length() - 2) {
- strOut += value.substring(0, i);
- // System.out.println("1strOut is now '" + strOut + "'");
- String str = value.substring(i);
- String strEnd = "";
- int j = str.indexOf(';');
- if (j < 0) {
- strOut += str;
- // System.out.println("2strOut is now '" + strOut + "'");
- break; // no termination
- }
- if (j < str.length()-1) {
- value = str.substring(j+1);
- }
- else {
- value = "";
- }
- str = str.substring(1, j);
- // System.out.println("value is now '" + value + "'");
- // System.out.println("str is now '" + str + "'");
- // TODO: Should use a hashtable and support more characters
- switch (Character.toUpperCase(str.charAt(0)))
- {
- case 'A':
- if (str.equalsIgnoreCase("amp")) {
- str = "&";
- }
- break;
- case 'C':
- if (str.equalsIgnoreCase("copy")) {
- str = "(c)";
- }
- break;
- case 'G':
- if (str.equalsIgnoreCase("gt")) {
- str = ">";
- }
- break;
- case 'L':
- if (str.equalsIgnoreCase("lt")) {
- str = "<";
- }
- break;
- case 'N':
- if (str.equalsIgnoreCase("nbsp")) {
- str = " ";
- }
- break;
- case 'Q':
- if (str.equalsIgnoreCase("quot")) {
- str = "\"";
- }
- break;
- case 'R':
- if (str.equalsIgnoreCase("reg")) {
- str = "(R)";
- }
- break;
- }
- strOut += str;
- i = value.indexOf('&');
- if (i < 0) {
- strOut += value;
- // System.out.println("3strOut is now '" + strOut + "'");
- }
- }
-
- // System.out.println("4strOut is now '" + strOut + "'");
- return strOut;
- }
- }
-
-
-
- // Here is a sample show how to use this class
- // CshTester.htm
- //<HTML>
- //<HEAD>
- //<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
- //</HEAD>
- //<BODY>
- //
- //<P> </P>
- //
- //
- //<!-- Insert HTML here -->
- // <applet
- // code=robohelp/CshTester.class
- // name=CshTester
- // width=500
- // height=500 MAYSCRIPT VIEWASTEXT>
- // <param name=defaulturl value="africa_csh.htm">
- // <param name=left value=50>
- // <param name=top value=50>
- // <param name=width value=600>
- // <param name=height value=400>
- // </applet>
- //
- //</BODY>
- //</HTML>
-
-
- // CshTester.java
- //package robohelp;
- //
- //import java.awt.*;
- //import java.applet.*;
- //import java.net.*;
- //import java.io.*;
- //
- ///**
- // * This class reads PARAM tags from its HTML host page and sets
- // * the color and label properties of the applet. Program execution
- // * begins with the init() method.
- // */
- //public class CshTester extends Applet
- //{
- // GridBagLayout gridBagLayout1 = new GridBagLayout();
- // Label label1 = new Label();
- // Label label2 = new Label();
- // Label label3 = new Label();
- // TextField m_edtProject = new TextField();
- // Checkbox m_btnId = new Checkbox();
- // Checkbox m_btnNumber = new Checkbox();
- // Checkbox m_btnRmtURL = new Checkbox();
- // Checkbox m_btnAuto = new Checkbox();
- // CheckboxGroup m_grpId = new CheckboxGroup();
- // TextField m_edtValue = new TextField();
- // Label label4 = new Label();
- // Label label5 = new Label();
- // TextField m_edtLeft = new TextField();
- // Label label6 = new Label();
- // TextField m_edtTop = new TextField();
- // Label label7 = new Label();
- // Label label8 = new Label();
- // TextField m_edtHeight = new TextField();
- // TextField m_edtWidth = new TextField();
- // Label label9 = new Label();
- // Checkbox m_btnLocation = new Checkbox();
- // Checkbox m_btnToolbar = new Checkbox();
- // Checkbox m_btnMenubar = new Checkbox();
- // Checkbox m_btnStatus = new Checkbox();
- // Checkbox m_btnScrollbars = new Checkbox();
- // Checkbox m_btnResizable = new Checkbox();
- // Button m_btnTest = new Button();
- // Label label10 = new Label();
- // TextArea m_areaSyntax = new TextArea();
- //
- // // width, height top, left IE
- // // ScreenX, ScreenY, OuterWidth, OuterHeight NS
- //
- // private String m_strSyntax;
- //
- // public void init()
- // {
- // label1.setText("Test applet for WebHelp Context Sensitive Help for java applets");
- // this.setLayout(gridBagLayout1);
- // label3.setText("Help project csh file(<project name>_chs.htm):");
- // m_btnId.setName("m_btnId");
- // m_btnId.setCheckboxGroup(m_grpId);
- // m_btnId.setLabel("TopicId");
- // m_btnNumber.setName("m_btnNumber");
- // m_btnNumber.setCheckboxGroup(m_grpId);
- // m_btnNumber.setLabel("TopicNumber");
- // m_btnRmtURL.setName("m_btnRmtURL");
- // m_btnRmtURL.setCheckboxGroup(m_grpId);
- // m_btnRmtURL.setLabel("Remote URL");
- // m_btnAuto.setName("m_btnAuto");
- // m_btnAuto.setCheckboxGroup(m_grpId);
- // m_btnAuto.setLabel("Auto Detect");
- // m_btnAuto.setState(true);
- // m_edtValue.setName("m_edtValue");
- // m_edtValue.setColumns(60);
- // label4.setText("Topic window position:");
- // label5.setText("Left:");
- // m_edtLeft.setName("m_edtLeft");
- // m_edtLeft.setColumns(4);
- // label6.setText("Top:");
- // m_edtTop.setName("m_edtTop");
- // m_edtTop.setColumns(4);
- // label7.setText("Width:");
- // label8.setText("Height:");
- // m_edtHeight.setName("m_edtHeight");
- // m_edtHeight.setColumns(4);
- // m_edtWidth.setName("m_edtWidth");
- // m_edtWidth.setColumns(4);
- // label9.setText("Topic window options:");
- // m_btnLocation.setName("m_btnLocation");
- // m_btnLocation.setLabel("Location");
- // m_btnToolbar.setName("m_btnToolbar");
- // m_btnToolbar.setLabel("Toolbar");
- // m_btnMenubar.setName("m_btnMenubar");
- // m_btnMenubar.setLabel("Menubar");
- // m_btnStatus.setName("m_btnStatus");
- // m_btnStatus.setLabel("Status");
- // m_btnScrollbars.setName("m_btnScrollbars");
- // m_btnScrollbars.setLabel("Scrollbars");
- // m_btnResizable.setName("m_btnResizable");
- // m_btnResizable.setLabel("Resizable");
- //
- // m_btnResizable.setState(true);
- // m_btnScrollbars.setState(true);
- //
- // m_btnTest.setName("m_btnTest");
- // m_btnTest.setLabel("Test Help");
- // label10.setText("Syntax to add to your java applet code:");
- // m_areaSyntax.setName("m_areaSyntax");
- // m_areaSyntax.setColumns(80);
- // m_areaSyntax.setEditable(false);
- //
- // m_edtProject.setName("");
- // m_edtProject.setColumns(60);
- //
- // this.add(label1, GetGridBagConstraints(0, 0, 6, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 6, 0));
- // this.add(label2, GetGridBagConstraints(0, 1, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 37), 0, 0));
- // this.add(label3, GetGridBagConstraints(1, 2, 5, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(m_edtProject, GetGridBagConstraints(1, 3, 5, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(m_btnId, GetGridBagConstraints(1, 4, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(m_btnNumber, GetGridBagConstraints(2, 4, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(m_btnRmtURL, GetGridBagConstraints(3, 4, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(m_btnAuto, GetGridBagConstraints(4, 4, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(m_edtValue, GetGridBagConstraints(1, 5, 5, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(label4, GetGridBagConstraints(1, 6, 2, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(label6, GetGridBagConstraints(4, 7, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(m_edtTop, GetGridBagConstraints(5, 7, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(m_edtHeight, GetGridBagConstraints(5, 8, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(label8, GetGridBagConstraints(4, 8, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(m_edtLeft, GetGridBagConstraints(3, 7, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(m_edtWidth, GetGridBagConstraints(3, 8, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(label5, GetGridBagConstraints(2, 7, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(label7, GetGridBagConstraints(2, 8, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(label9, GetGridBagConstraints(1, 9, 2, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(m_btnLocation, GetGridBagConstraints(2, 10, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(m_btnToolbar, GetGridBagConstraints(3, 10, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(m_btnMenubar, GetGridBagConstraints(4, 10, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(m_btnStatus, GetGridBagConstraints(2, 11, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(m_btnScrollbars, GetGridBagConstraints(3, 11, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(m_btnResizable, GetGridBagConstraints(4, 11, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(m_btnTest, GetGridBagConstraints(3, 12, 1, 1, 0.0, 0.0
- // ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(label10, GetGridBagConstraints(0, 13, 6, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- // this.add(m_areaSyntax, GetGridBagConstraints(0, 14, 6, 1, 0.0, 0.0
- // ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 60, 0));
- //
- // String strDefaultURL = getParameter("defaulturl");
- // if (strDefaultURL != null)
- // m_edtProject.setText(strDefaultURL);
- //
- // String strLeft = getParameter("left");
- // try {
- // if (strLeft != null && Integer.parseInt(strLeft, 10)>=0 )
- // m_edtLeft.setText(strLeft);
- // else
- // m_edtLeft.setText("0");
- // }
- // catch (NumberFormatException e) {
- // m_edtLeft.setText("0");
- // }
- //
- // String strTop = getParameter("top");
- // try {
- // if (strTop != null && Integer.parseInt(strTop, 10)>=0)
- // m_edtTop.setText(strTop);
- // else
- // m_edtTop.setText("0");
- // }
- // catch (NumberFormatException e) {
- // m_edtTop.setText("0");
- // }
- //
- // String strWidth = getParameter("width");
- // try {
- // if (strWidth != null && Integer.parseInt(strWidth, 10)>=0)
- // m_edtWidth.setText(strWidth);
- // else
- // m_edtWidth.setText("0");
- // }
- // catch (NumberFormatException e) {
- // m_edtWidth.setText("0");
- // }
- //
- // String strHeight = getParameter("height");
- // try {
- // if (strHeight != null && Integer.parseInt(strHeight, 10)>=0)
- // m_edtHeight.setText(strHeight);
- // else
- // m_edtHeight.setText("0");
- // }
- // catch (NumberFormatException e) {
- // m_edtHeight.setText("0");
- // }
- // }
- //
- // public boolean action(Event e, Object o)
- // {
- // if (e.target != m_btnTest) return true;
- // String strURL = m_edtProject.getText();
- //
- // String strTopic = "";
- // if (m_grpId.getSelectedCheckbox() == m_btnAuto) {
- // strTopic = m_edtValue.getText();
- // }
- // else if (m_grpId.getSelectedCheckbox() == m_btnId) {
- // strTopic = "TopicId=" + m_edtValue.getText();
- // }
- // else if (m_grpId.getSelectedCheckbox() == m_btnNumber) {
- // strTopic = "TopicNumber=" + m_edtValue.getText();
- // }
- // else if (m_grpId.getSelectedCheckbox() == m_btnRmtURL) {
- // strTopic = "RemoteURL=" + m_edtValue.getText();
- // }
- //
- // String strWindowOptions = "";
- //
- // int left, top, width, height, flag=0;
- // try {
- // left = Integer.parseInt(m_edtLeft.getText(), 10);
- // }
- // catch (Exception x) {
- // left = 0;
- // }
- // try {
- // top = Integer.parseInt(m_edtTop.getText(), 10);
- // }
- // catch (Exception y) {
- // top = 0;
- // }
- //
- // try {
- // width = Integer.parseInt(m_edtWidth.getText(), 10);
- // }
- // catch (Exception z) {
- // width = 0;
- // }
- // try {
- // height = Integer.parseInt(m_edtHeight.getText(), 10);
- // }
- // catch (Exception w) {
- // height = 0;
- // }
- //
- // String strFlag = "";
- // if (m_btnLocation.getState()) {
- // flag |= ShowWebHelp.WOF_LOCATION;
- // strFlag += "| ShowWebHelp.WOF_LOCATION ";
- // }
- //
- // if (m_btnMenubar.getState()) {
- // flag |= ShowWebHelp.WOF_MENUBAR;
- // strFlag += "| ShowWebHelp.WOF_MENUBAR ";
- // }
- //
- // if (m_btnResizable.getState()) {
- // flag |= ShowWebHelp.WOF_RESIZABLE;
- // strFlag += "| ShowWebHelp.WOF_RESIZABLE ";
- // }
- //
- // if (m_btnToolbar.getState()) {
- // flag |= ShowWebHelp.WOF_TOOLBAR;
- // strFlag += "| ShowWebHelp.WOF_TOOLBAR ";
- // }
- //
- // if (m_btnStatus.getState()) {
- // flag |= ShowWebHelp.WOF_STATUS;
- // strFlag += "| ShowWebHelp.WOF_STATUS ";
- // }
- //
- // if (m_btnScrollbars.getState()) {
- // flag |= ShowWebHelp.WOF_SCROLLBARS;
- // strFlag += "| ShowWebHelp.WOF_SCROLLBARS ";
- // }
- //
- // if (strFlag.length() == 0) {
- // strFlag = "0";
- // }
- // else {
- // strFlag = strFlag.substring(2, strFlag.length()-1);
- // }
- //
- // m_strSyntax = "import robohelp.ShowWebHelp;\r\n\r\n";
- // m_strSyntax += " cshURL = \"" + strURL + "\";\r\n";
- // m_strSyntax += " topic = \"" + strTopic + "\";\r\n";
- // m_strSyntax += " options = " + strFlag + ";\r\n";
- // m_strSyntax += " ShowWebHelp.context(cshURL, topic, " + left + ","
- // + top + "," + width + "," + height + ", options, applet);\r\n";
- //
- // m_areaSyntax.setText(m_strSyntax);
- //
- // if (!ShowWebHelp.context(strURL, strTopic, left, top, width, height, flag, this)) {
- // m_areaSyntax.setText("Error: Unable to find the topic, please check the URL");
- // return false;
- // }
- // else
- // return true;
- //
- // }
- //
- // GridBagConstraints GetGridBagConstraints(int gridx, int gridy,
- // int gridwidth, int gridheight,
- // double weightx, double weighty,
- // int anchor, int fill,
- // Insets insets, int ipadx, int ipady) {
- // GridBagConstraints gbc = new GridBagConstraints();
- //
- // gbc.gridx = gridx;
- // gbc.gridy = gridy;
- // gbc.gridwidth = gridwidth;
- // gbc.gridheight = gridheight;
- // gbc.fill = fill;
- // gbc.ipadx = ipadx;
- // gbc.ipady = ipady;
- // gbc.insets = insets;
- // gbc.anchor = anchor;
- // gbc.weightx = weightx;
- // gbc.weighty = weighty;
- // return gbc;
- // }
- //}
-